CS424 Assignment 4

Due 22 February 2007.

  1. In the following, assume that the NWS variable 'max' changes very infrequently.
    for x in MyCandidateList:
        currentMax = ws.find('max')
        if noGo(currentMax, x): continue
        y = f(x)
        currentMax = ws.fetch('max')
        if y > currentMax: currentMax = y
        ws.store('max', currentMax)
    
    Modify this pseudocode to reduce the number of times coordination operations are executed. Hint: the modification we have in mind is trivial — but you are welcome to do something more complicated if you wish.
  2. Write a test code to verify that eachElem executes tasks (not just return results) in order.
  3. Using SleighRank, rewrite the nap example to calculate “load” for each worker and test that it is roughly even.
  4. Using blocking=False with eachWorker create a version of the cube example from the previous lecture that runs with sleigh compute servers.